package com.maochd.cloud.excel.controller;

import com.alibaba.fastjson.JSONObject;
import com.maochd.cloud.common.core.domain.R;
import com.maochd.cloud.excel.constant.ExcelConstant;
import com.maochd.cloud.excel.service.ExportService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/export")
@Api(value = "导出适配器", tags = "导出适配器")
public class ExportController {

    @Resource
    private ExportService exportService;

    @PostMapping(value = "/adapter")
    @ApiOperation(value = "导出适配器")
    public R<String> exportAdapter(@RequestBody JSONObject jsonObject) {
        exportService.exportAdapter(jsonObject);
        return R.ok(ExcelConstant.EXPORT_TEXT);
    }
}
